home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / Balloons.p < prev    next >
Encoding:
Text File  |  1992-01-29  |  9.5 KB  |  229 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Sunday, September 15, 1991 at 9:56 PM
  4.  Balloons.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1990-1991
  8.   All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT Balloons;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingBalloons}
  22. {$SETC UsingBalloons := 1}
  23.  
  24. {$I+}
  25. {$SETC BalloonsIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingQuickdraw}
  31. {$I $$Shell(PInterfaces)Quickdraw.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingMenus}
  34. {$I $$Shell(PInterfaces)Menus.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED UsingTextEdit}
  37. {$I $$Shell(PInterfaces)TextEdit.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED UsingTraps}
  40. {$I $$Shell(PInterfaces)Traps.p}
  41. {$ENDC}
  42. {$SETC UsingIncludes := BalloonsIncludes}
  43.  
  44. CONST
  45. hmBalloonHelpVersion = $0002;    { The real version of the Help Manager }
  46.  
  47. {Help Mgr error range: -850 to -874}
  48. hmHelpDisabled = -850;            { Show Balloons mode was off, call to routine ignored }
  49. hmBalloonAborted = -853;        { Returned if mouse was moving or mouse wasn't in window port rect }
  50. hmSameAsLastBalloon = -854;        { Returned from HMShowMenuBalloon if menu & item is same as last time }
  51. hmHelpManagerNotInited = -855;    { Returned from HMGetHelpMenuHandle if help menu not setup }
  52. hmSkippedBalloon = -857;        { Returned from calls if helpmsg specified a skip balloon }
  53. hmWrongVersion = -858;            { Returned if help mgr resource was the wrong version }
  54. hmUnknownHelpType = -859;        { Returned if help msg record contained a bad type }
  55. hmOperationUnsupported = -861;    { Returned from HMShowBalloon call if bad method passed to routine }
  56. hmNoBalloonUp = -862;            { Returned from HMRemoveBalloon if no balloon was visible when call was made }
  57. hmCloseViewActive = -863;        { Returned from HMRemoveBalloon if CloseView was active }
  58.  
  59. kHMHelpMenuID = -16490;            { Resource ID and menu ID of help menu }
  60. kHMAboutHelpItem = 1;            { help menu item number of About Balloon Help… }
  61. kHMShowBalloonsItem = 3;        { help menu item number of Show/Hide Balloons }
  62.  
  63. kHMHelpID = -5696;                { ID of various Help Mgr package resources (in Pack14 range) }
  64. kBalloonWDEFID = 126;            { Resource ID of the WDEF proc used in standard balloons }
  65.  
  66. { Dialog item template type constant }
  67. helpItem = 1;                    { key value in DITL template that corresponds to the help item }
  68.  
  69. { Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources }
  70. hmDefaultOptions = 0;            { default options for help manager resources }
  71. hmUseSubID = 1;                    { treat resID's in resources as subID's of driver base ID (for Desk Accessories) }
  72. hmAbsoluteCoords = 2;            { ignore window port origin and treat rectangles as absolute coords (local to window) }
  73. hmSaveBitsNoWindow = 4;            { don't create a window, just blast bits on screen. No update event is generated }
  74. hmSaveBitsWindow = 8;            { create a window, but restore bits behind window when window goes away & generate update event }
  75. hmMatchInTitle = 16;            { for hwin resources, match string anywhere in window title string }
  76.  
  77. { Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources }
  78. kHMStringItem = 1;                { pstring used in resource }
  79. kHMPictItem = 2;                { 'PICT' ResID used in resource }
  80. kHMStringResItem = 3;            { 'STR#' ResID & index used in resource }
  81. kHMTEResItem = 6;                { Styled Text Edit ResID used in resource ('TEXT' & 'styl') }
  82. kHMSTRResItem = 7;                { 'STR ' ResID used in resource }
  83. kHMSkipItem = 256;                { don't display a balloon }
  84. kHMCompareItem = 512;            { Compare pstring in menu item w/ PString in resource item ('hmnu' only) }
  85. kHMNamedResourceItem = 1024;    { Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) }
  86. kHMTrackCntlItem = 2048;        { Reserved }
  87.  
  88. { Constants for hmmHelpType's when filling out HMMessageRecord }
  89. khmmString = 1;                    { help message contains a PString }
  90. khmmPict = 2;                    { help message contains a resource ID to a 'PICT' resource }
  91. khmmStringRes = 3;                { help message contains a res ID & index to a 'STR#' resource }
  92. khmmTEHandle = 4;                { help message contains a Text Edit handle }
  93. khmmPictHandle = 5;                { help message contains a Picture handle }
  94. khmmTERes = 6;                    { help message contains a res ID to 'TEXT' & 'styl' resources }
  95. khmmSTRRes = 7;                    { help message contains a res ID to a 'STR ' resource }
  96.  
  97. { ResTypes for Styled TE Handles in Resources }
  98. kHMTETextResType = 'TEXT';        { Resource Type of text data for styled TE record w/o style info }
  99. kHMTEStyleResType = 'styl';        { Resource Type of style information for styled TE record }
  100.  
  101. { Generic defines for the state parameter used when extracting 'hmnu' & 'hdlg' messages }
  102. kHMEnabledItem = 0;                { item is enabled, but not checked or control value = 0 }
  103. kHMDisabledItem = 1;            { item is disabled, grayed in menus or disabled in dialogs }
  104. kHMCheckedItem = 2;                { item is enabled, and checked or control value = 1 }
  105. kHMOtherItem = 3;                { item is enabled, and control value > 1 }
  106.  
  107. { Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages }
  108. kHMMenuResType = 'hmnu';        { ResType of help resource for supporting menus }
  109. kHMDialogResType = 'hdlg';        { ResType of help resource for supporting dialogs }
  110. kHMWindListResType = 'hwin';    { ResType of help resource for supporting windows }
  111. kHMRectListResType = 'hrct';    { ResType of help resource for rectangles in windows }
  112. kHMOverrideResType = 'hovr';    { ResType of help resource for overriding system balloons }
  113. kHMFinderApplResType = 'hfdr';    { ResType of help resource for custom balloon in Finder }
  114.  
  115. { Method parameters to pass to HMShowBalloon }
  116. kHMRegularWindow = 0;            { Create a regular window floating above all windows }
  117. kHMSaveBitsNoWindow = 1;        { Just save the bits and draw (for MDEF calls) }
  118. kHMSaveBitsWindow = 2;            { Regular window, save bits behind, AND generate update event }
  119.  
  120. TYPE
  121. HMStringResType = RECORD
  122.  hmmResID: INTEGER;
  123.  hmmIndex: INTEGER;
  124.  END;
  125.  
  126. HMMessageRecPtr    = ^HMMessageRecord;
  127. HMMessageRecord    = RECORD
  128.                 hmmHelpType            : INTEGER;
  129.                 CASE INTEGER OF
  130.                 khmmString:
  131.                     (hmmString: STR255);
  132.                 khmmPict:
  133.                     (hmmPict: INTEGER);
  134.                 khmmStringRes:
  135.                     (hmmStringRes: HMStringResType);
  136.                 khmmTEHandle:
  137.                     (hmmTEHandle: TEHandle);
  138.                 khmmPictHandle:
  139.                     (hmmPictHandle: PicHandle);
  140.                 khmmTERes:
  141.                     (hmmTERes: INTEGER);
  142.                 khmmSTRRes:
  143.                     (hmmSTRRes: INTEGER);
  144.                 END;
  145.  
  146.  
  147.  
  148. {  Public Interfaces  }
  149. FUNCTION HMGetHelpMenuHandle(VAR mh: MenuHandle): OSErr;
  150.  INLINE $303C,$0200,_Pack14;
  151. FUNCTION HMShowBalloon(aHelpMsg: HMMessageRecord;
  152.                        tip: Point;
  153.                        alternateRect: RectPtr;
  154.                        tipProc: Ptr;
  155.                        theProc: INTEGER;
  156.                        variant: INTEGER;
  157.                        method: INTEGER): OSErr;
  158.  INLINE $303C,$0B01,_Pack14;
  159. FUNCTION HMRemoveBalloon: OSErr;
  160.  INLINE $303C,$0002,_Pack14;
  161. FUNCTION HMGetBalloons: BOOLEAN;
  162.  INLINE $303C,$0003,_Pack14;
  163. FUNCTION HMSetBalloons(flag: BOOLEAN): OSErr;
  164.  INLINE $303C,$0104,_Pack14;
  165. FUNCTION HMShowMenuBalloon(itemNum: INTEGER;
  166.                            itemMenuID: INTEGER;
  167.                            itemFlags: LONGINT;
  168.                            itemReserved: LONGINT;
  169.                            tip: Point;
  170.                            alternateRect: RectPtr;
  171.                            tipProc: Ptr;
  172.                            theProc: INTEGER;
  173.                            variant: INTEGER): OSErr;
  174.  INLINE $303C,$0E05,_Pack14;
  175. FUNCTION HMGetIndHelpMsg(whichType: ResType;
  176.                          whichResID: INTEGER;
  177.                          whichMsg: INTEGER;
  178.                          whichState: INTEGER;
  179.                          VAR options: LONGINT;
  180.                          VAR tip: Point;
  181.                          VAR altRect: Rect;
  182.                          VAR theProc: INTEGER;
  183.                          VAR variant: INTEGER;
  184.                          VAR aHelpMsg: HMMessageRecord;
  185.                          VAR count: INTEGER): OSErr;
  186.  INLINE $303C,$1306,_Pack14;
  187. FUNCTION HMIsBalloon: BOOLEAN;
  188.  INLINE $303C,$0007,_Pack14;
  189. FUNCTION HMSetFont(font: INTEGER): OSErr;
  190.  INLINE $303C,$0108,_Pack14;
  191. FUNCTION HMSetFontSize(fontSize: INTEGER): OSErr;
  192.  INLINE $303C,$0109,_Pack14;
  193. FUNCTION HMGetFont(VAR font: INTEGER): OSErr;
  194.  INLINE $303C,$020A,_Pack14;
  195. FUNCTION HMGetFontSize(VAR fontSize: INTEGER): OSErr;
  196.  INLINE $303C,$020B,_Pack14;
  197. FUNCTION HMSetDialogResID(resID: INTEGER): OSErr;
  198.  INLINE $303C,$010C,_Pack14;
  199. FUNCTION HMSetMenuResID(menuID: INTEGER;
  200.                         resID: INTEGER): OSErr;
  201.  INLINE $303C,$020D,_Pack14;
  202. FUNCTION HMBalloonRect(aHelpMsg: HMMessageRecord;
  203.                        VAR coolRect: Rect): OSErr;
  204.  INLINE $303C,$040E,_Pack14;
  205. FUNCTION HMBalloonPict(aHelpMsg: HMMessageRecord;
  206.                        VAR coolPict: PicHandle): OSErr;
  207.  INLINE $303C,$040F,_Pack14;
  208. FUNCTION HMScanTemplateItems(whichID: INTEGER;
  209.                              whichResFile: INTEGER;
  210.                              whichType: ResType): OSErr;
  211.  INLINE $303C,$0410,_Pack14;
  212. FUNCTION HMExtractHelpMsg(whichType: ResType;whichResID: INTEGER;whichMsg: INTEGER;
  213.  whichState: INTEGER;VAR aHelpMsg: HMMessageRecord): OSErr;
  214.  INLINE $303C,$0711,_Pack14;
  215. FUNCTION HMGetDialogResID(VAR resID: INTEGER): OSErr;
  216.  INLINE $303C,$0213,_Pack14;
  217. FUNCTION HMGetMenuResID(menuID: INTEGER;VAR resID: INTEGER): OSErr;
  218.  INLINE $303C,$0314,_Pack14;
  219. FUNCTION HMGetBalloonWindow(VAR window: WindowPtr): OSErr;
  220.  INLINE $303C,$0215,_Pack14;
  221.  
  222.  
  223. {$ENDC} { UsingBalloons }
  224.  
  225. {$IFC NOT UsingIncludes}
  226.  END.
  227. {$ENDC}
  228.  
  229.